package com.skymxc.example;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.skymxc.annotation.OnClick;
import com.skymxc.annotation.OnLongClick;
import com.skymxc.clickroute.BuildConfig;
import com.skymxc.clickroute.ClickRoute;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ClickRoute.proxyBind(this);
    }

    @OnClick(R.id.btn_hello)
    public void onClick_1(View view) {

        Log.i(TAG, "onClick_1: "+((TextView) view).getText().toString());
        Toast.makeText(this,((TextView) view).getText().toString(),Toast.LENGTH_SHORT);
    }

    @OnLongClick(R.id.btn_hello)
    public boolean onLongClick_2(View view) {
        Log.i(TAG, "onLongClick_2: "+((TextView) view).getText().toString());
        Toast.makeText(this,((TextView) view).getText().toString(),Toast.LENGTH_SHORT);
        return true;
    }
}